#include	"Helper.h"
#include	<Math/Vector.h>
#include	<windows.h>
#include	<gl/gl.h>
#include	<gl/glu.h>

void glhPerspective(float fieldOfView, float nearPlane, float farPlane, const Vector2i & resolution)
{
	glViewport(0, 0, resolution[0], resolution[1]);
	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();
	gluPerspective(fieldOfView, double(resolution[0])/double(resolution[1]), nearPlane, farPlane);
	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();
}

void glhPushOrtho(const Vector2i & resolution)
{
	glMatrixMode (GL_PROJECTION);
	glPushMatrix();
	glLoadIdentity();
	gluOrtho2D(0, double(resolution[0]), 0, double(resolution[1]));
	glMatrixMode (GL_MODELVIEW);
	glPushMatrix();
	glLoadIdentity();
	glTranslatef(0.375f, 0.375f, 0.0f);
}

void glhPopOrtho()
{
	glMatrixMode (GL_PROJECTION);
	glPopMatrix();
	glMatrixMode (GL_MODELVIEW);
	glPopMatrix();
}


